<script>
	export default {
		globalData: {
			myAdd: uni.getStorageSync('myAdd') || '', //所在地区信息
			addList: uni.getStorageSync('addList') || [], //地址列表缓存
			location: uni.getStorageSync('location') || '', //当前定位信息
		},
		onLaunch(opt) {
			this.$getConfig()
		},
		onShow() {
			// 启动或重启即时通讯
			console.log('App onShow');
			this.$store.dispatch('chat/start');
			// #ifdef MP
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				console.log('update', res.hasUpdate);
			});
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});
			});
			updateManager.onUpdateFailed(function(res) {
				// 新的版本下载失败
			});
			// #endif
		},
		onHide() {
			// 断开即时通讯
			this.$store.dispatch('chat/close');
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "/static/css/public.scss";


	.font-f2 {
		font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular;
	}

	.color-zs {
		color: $zs;
	}

	.bg-zs {
		background-color: $zs;
	}

	.color-fs {
		color: $fs;
	}

	.bg-fs {
		background-color: $fs;
	}

	page {
		background-color: #F8F8F8;
		font-size: 28rpx;
		color: #333333;
		font-family: PingFangSC;
		word-break: break-all; //文本换行
	}


	.loginBoxShadow {
		box-shadow: 0px 6px 12px 2px rgba(0, 0, 0, 0.06);
	}

	.color-232323 {
		color: #232323;
	}

	.cyan {
		background: rgba(0, 190, 195, 0.07);
		border-radius: 8rpx;
		color: #00bec3;
	}

	.yellow {
		background: rgba(234, 135, 68, 0.07);
		border-radius: 8rpx;
		color: #ea8744;
	}

	.blue {
		background: rgba(45, 168, 253, 0.07);
		border-radius: 8rpx;
		color: #2da8fd;
	}


	.bg-zs-007 {
		background: rgba(0, 190, 195, 0.07);
	}

	.color-00111d {
		color: #00111d;
	}

	.border-dashed {
		border: 1rpx dashed #cfcfcf;
	}

	.color-B7B5B5 {
		color: #B7B5B5;
	}

	.bottom {
		background: url(~@/static/img/index/bottom.png) center bottom/ 74rpx 16rpx no-repeat;
	}

	.border-11CBC5 {
		border: 1px solid #11CBC5;
	}

	.border-46A6FE {
		border: 1px solid #46A6FE;
	}

	.color-yellow {
		color: #EA8744;
	}

	.border-yellow {
		border: 1px solid #EA8744;
	}

	.color-FF704B {
		color: #FF704B;
	}

	.bg-FF704B {
		background-color: #FF704B;
	}

	.dashed {
		width: 0rpx;
		height: 164rpx;
		background: rgba(0, 0, 0, 0.00);
		border: 1.2rpx dashed #e2e2e2;
	}

	.bg-zs-linear-gradient {
		background: linear-gradient(180deg, #00c2cf, #1ed2be);
	}
</style>
